export default function MapLoader() {

	return new Promise((resolve, reject) => {
		window._AMapSecurityConfig = {
			securityJsCode:'6ca88a2d8414185b4f667d390c7e1df3',
		}
		if (window.AMap) {
			resolve(window.AMap);
		} else {
			var script = document.createElement('script');
			script.type = "text/javascript";
			script.async = true;
			script.src ="https://webapi.amap.com/maps?v=1.4.15&key=bd8687352b1ee3d627b53384112e2e6d";
			script.onerror = reject;
			document.head.appendChild(script);
		}
		window.initAMap = () => {
			resolve(window.AMap);
		};
	});
}